package com.qmo.edu.http;


import com.qmo.edu.base.BaseResponse;

import com.qmo.edu.moudle.bean.CheckNewBean;
import com.qmo.edu.moudle.bean.LoginBean;
import com.qmo.edu.moudle.bean.LoginOut;
import com.qmo.edu.moudle.bean.UserInfoBean;

import java.util.Map;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Url;


/**
 * Created by ${} on 2019/3/25/025.
 *
 * @author cyx
 */

public interface ApiService {
//    @Headers({"Content-Type: application/x-www-form-urlencoded", "Accept: application/json"})
//    @POST()
//    Observable<LoginBean> login(@Url String url, @Body RequestBody body);   //用户登录
    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @POST("api/Check/Login")
    Observable<LoginBean> login(@Body RequestBody body);   //用户登录

    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @POST("Api/Account/Logout")
    Observable<BaseResponse<LoginOut>> logout(@Header("Authorization") String token);


    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @POST("api/users/ChangePassword")
    Observable<BaseResponse<String>> updatePwd(@Header("Authorization") String token, @Body() Map<String, String> map);


    /**
     * 用户信息
     */
    @GET("api/users/UserInfo/{id}")
    Observable<BaseResponse<UserInfoBean>> getUserInfo(@Header("Authorization") String token, @Path("id") String id);


    /**
     * 获取用户所能进行的巡检信息
     */
    @GET("api/MobileInspect/GetInspectInfo")
    Observable<BaseResponse<CheckNewBean>> getInspectInfo(@Header("X-Token") String token);

}
